#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time      :2021/7/16 14:08
# @Author    :cjw
from typing import Optional

from pydantic import BaseModel, EmailStr


class UserBase(BaseModel):
	email: Optional[EmailStr] = None
	full_name: Optional[str] = None
	is_active: Optional[bool] = True
	is_superuser: Optional[bool] = False


class UserCreate(UserBase):
	email: EmailStr
	password: str


class UserUpdate(UserBase):
	password: Optional[str] = None


class UserInDBBase(UserBase):
	id: Optional[int] = None

	class Config:
		orm_mode = True


class User(UserInDBBase):
	pass


class UserInDB(UserInDBBase):
	hashed_password: str
